<?php

/**
 * EncEvaluacion filter form base class.
 *
 * @package    encuestas
 * @subpackage filter
 * @author     qualem
 */
abstract class BaseEncEvaluacionFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'aciertos'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'fallos'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'calificacion'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'tipo'          => new sfWidgetFormFilterInput(),
      'observaciones' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'created_at'    => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'updated_at'    => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'aciertos'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'fallos'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'calificacion'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'tipo'          => new sfValidatorPass(array('required' => false)),
      'observaciones' => new sfValidatorPass(array('required' => false)),
      'created_at'    => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'updated_at'    => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
    ));

    $this->widgetSchema->setNameFormat('enc_evaluacion_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'EncEvaluacion';
  }

  public function getFields()
  {
    return array(
      'id'            => 'Number',
      'aciertos'      => 'Number',
      'fallos'        => 'Number',
      'calificacion'  => 'Number',
      'tipo'          => 'Text',
      'observaciones' => 'Text',
      'created_at'    => 'Date',
      'updated_at'    => 'Date',
    );
  }
}
